#ifndef NET_CLIENT_H
#define NET_CLIENT_H
#include <string>
#include <boost/asio.hpp>

using namespace boost::asio::ip;

class Client
{
public:
	Client(boost::asio::io_service& io_service,
		const std::string host, short port);

	void sendMessage(const std::string& message);

private:
	void onConnect(const boost::system::error_code& err);
	void onWriteFinish(const boost::system::error_code& err, std::size_t bytes_transferred);
	void onMessage(const boost::system::error_code& err, std::size_t bytes_transferred);

private:
	boost::asio::io_service&	m_service;
	tcp::socket					m_client;
	boost::asio::streambuf		m_requestStream;
	boost::asio::streambuf		m_responseStream;
};

#endif